package com.zs.backend.common.utils;

import java.util.Calendar;
import java.util.Date;

public class DateUtils {

    /**
     * 日期 +
     * @param date
     * @param day
     * @return
     */
    public static Date daysOperation(Date date, int day) {
        if (date != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(date);
            cal.add(5, day);
            return cal.getTime();
        } else {
            return null;
        }
    }

    public static void main(String[] args) {
        System.out.println(daysOperation(new Date(), -1));
    }

}
